# Contributor: Bart Ribbers <bribbers@disroot.org>
# Maintainer: Luca Weiss <luca@z3ntu.xyz>
pkgname=lomiri-libusermetrics
pkgver=1.3.1
pkgrel=0
pkgdesc='Library for exporting anonymous metrics about users'
arch="all !armhf" # blocked by qt5-qtxmlpatterns-dev
url="https://gitlab.com/ubports/development/core/libusermetrics"
license="GPL-3.0-only AND LGPL-3.0-only AND LGPL-2.1-only"
depends_dev="
	click-dev
	gsettings-qt-dev
	libapparmor-dev
	qdjango-dev
	qt5-qtxmlpatterns-dev
	"
makedepends="
	$depends_dev
	cmake-extras
	doxygen
	gmock
	gtest-dev
	intltool
	libapparmor
	libqtdbustest
	qt5-qtbase-dev
	samurai
	"
checkdepends="dbus"
source="https://gitlab.com/ubports/development/core/libusermetrics/-/archive/$pkgver/libusermetrics-$pkgver.tar.gz"
subpackages="$pkgname-dev $pkgname-doc $pkgname-lang"
builddir="$srcdir/libusermetrics-$pkgver"

build() {
	cmake -B build -G Ninja \
		-DCMAKE_INSTALL_PREFIX=/usr \
		-DCMAKE_INSTALL_LIBDIR=lib \
		-DBUILD_SHARED_LIBS=ON \
		-DCMAKE_BUILD_TYPE=None
	cmake --build build
}

check() {
	ctest --test-dir build --output-on-failure
}

package() {
	DESTDIR="$pkgdir" cmake --install build
}

sha512sums="
4209c0a9d038e392bcc29de73c07c6120427137ad16d4c0b2a911888f4e9d493c56b12513871093b25e0c96440df16e8bdd0359276aeb0f69acc0b57996ec53d  libusermetrics-1.3.1.tar.gz
"
